/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package localAI.agents;

import java.io.IOException;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import localAI.env.def.Direction;
import localAI.env.def.Orientation;
import localAI.env.Enviroment;

/**
 *
 * @author orcas
 */
public class HumanAgent extends Agent {

    private JPanel frame;
    
    public HumanAgent(String name, int row, int col, Orientation orientation) {
        super(name, row, col, orientation);
        frame = new JPanel();
    }
public Direction getMove1(Enviroment env) {
    int str=-1;
    System.out.print("a/w/d");
    try {
        str = System.in.read();
        switch (str) {
        case 'a': return Direction.left;
        case 'w': return Direction.fwd;
        case 'd': return Direction.right;
        case 'q': System.exit(0);
    }
        
    }
    catch (IOException e){}
    return null ;
}

    public Direction getMove(Enviroment env) {
        Object[] direction = {"<-","^","->"};
        int n = JOptionPane.showOptionDialog(frame,
    "Select a move","AI human agent",
    JOptionPane.YES_NO_CANCEL_OPTION,
    JOptionPane.QUESTION_MESSAGE,
    null,
    direction,
    direction[1]);
    System.out.println("**"+n+"**");
    switch (n) {
        case 0: return Direction.left;
        case 1: return Direction.fwd;
        case 2: return Direction.right;
        default: System.exit(0);
    }
    return null;
    }
}
